{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
<style>
		@media only screen and (max-width: 760px),(min-device-width: 768px) and (max-device-width:1024px)  {
		#mytable, #mytable thead, #mytable tbody, #mytable th, #mytable td, #mytable tr { 
			display: block; 
		}
		#mytable thead tr { 
			position: absolute;
			top: -9999px;
			left: -9999px;
		}
		#mytable td { 
			border: none;
			border-bottom: 1px solid #eee; 
			position: relative;
			padding-left:44% !important; 
			padding-top:10px ;
		}
	    #mytable tr{ margin-bottom:20px;}
		#mytable td:before { 
			position: absolute;
			top:10px;
			left:8px;
			width: 45%; 
			padding-right:10px;
			white-space: nowrap;
		}
		    #mytable td:nth-of-type(1):before { content: "标题"; }
			#mytable td:nth-of-type(2):before { content: "上级部门"; }
			#mytable td:nth-of-type(3):before { content: "下达时间"; }
			#mytable td:nth-of-type(4):before { content: "操作"; }
        }		
	</style>
	 <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form action="" method="POST">	
                <div class="box-header with-border">
                    <span class="fa  fa-volume-up" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">事务交代列表</p>
					<a href="index.php?a=affair.affairadd" class="btn btn-primary btn-sm" style="float:right; color:#fff;">事务发布</a>
                </div>
                <div class="box-body">
				    <div class="col-md-5 form-group" style="padding:0;">
						  <label for="inputPassword3" class="col-sm-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
							   标题：
						  </label>
						  <div class="input-group col-md-9 col-xs-12">
							    <input type="text" class="form-control" name="affair_title">
						  </div> 
				    </div>
					<div class="col-md-5 form-group" style="padding:0;">
						  <label for="inputPassword3" class="col-sm-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
							   部门：
						  </label>
						  <div class="input-group col-md-9 col-xs-12">
							   <select class="form-control" name="department_id" >
							   {%foreach from=$department_list key=key item=value%}
								  <option></option>
                                  <option value="{%$value.department_id%}">{%$value.department_name%}</option>
                                 
							   {%/foreach%}
                                </select>
						  </div>	  
				    </div>
					<div class="col-md-2 col-xs-12">
					   <button type="submit" class="btn btn-warning">查 询</button>
					</div>
					<div style="clear:both; height:10px;"></div>

                     <table class="table"  id="mytable">
                                <thead>
                                    <tr style="border-top:1px solid #f4f4f4">
                                        <td>标题</td>
                                        <td>部门</td>
										<td>发布时间</td>
										<td>操作</td>
                                    </tr>	
                                </thead>
                                <tbody>
								 {%foreach from=$affair_lists key=key item=value%}
                                    <tr>
                                        <td><a href="page.html" style="color:#444">{%$value.affair_title%}</a></td>
                                        <td>{%$value.department_name%}</td>
										<td>{%$value.create_time%}</td>
                                        <td>  
										      <a href="index.php?a=affair.affairupdate&affair_id={%$value.affair_id%}" class="btn btn-warning btn-xs">回 复</a>
                                        	  <span class="btn btn-success btn-xs"  data-toggle="modal" data-target="#myModal">
											  转 发 
											  </span>  
                                        </td>
                                    </tr>
								{%/foreach%}                                 
                            </tbody>
                        </table>
						
							<!--弹出框-->
						<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						  <div class="modal-dialog">
							<div class="modal-content" style="margin-top:120px;">
							  <form action="" method="post">
								  <div class="modal-header">
									<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
									<h4 class="modal-title" id="myModalLabel">转发给：</h4>
								  </div>
								  <div class="modal-body">
									   <label class="choice"><input type="checkbox" name="affair_transfer" value="0">全体教师</label>
									    {%foreach from=$department_list key=key item=value%}
									   <label class="choice"><input type="checkbox" name="affair_transfer[]" value="{%$value.department_id%}">{%$value.department_name%}</label>
									    {%/foreach%}
								  </div>
								  <div class="modal-footer">
									<button type="submit" class="btn btn-primary">确定</button>
								  </div>
							  </form>
							</div>
						  </div>
						</div>
                        <!--弹出框-->
				   </div><!--box-body -->
               </form>
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
{%include file="index.footer.tpl.php"%}
<script>
  $(function() {
    $( "#from" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
	  changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#to" ).datepicker( "option", "minDate", selectedDate );
      }
    });
    $( "#to" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
      changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#from" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });
</script>
